<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>滑块验证 - 光年(Light Year Admin)后台管理系统模板</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<style>
.ui-slider-wrap {
	background: #ececec;
	position: relative;
    -webkit-border-radius: 2px;
    border-radius: 2px;
}
.ui-slider-wrap .ui-slider-bg {
	width: 0;
    -webkit-border-radius: 2px;
    border-radius: 2px;
}
.ui-slider-wrap .ui-slider-btn {
	position: absolute;
	top: 0;
	left: 0;
	cursor: move;
	text-align: center;
    box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.125);
	background: #fff;
    -webkit-border-radius: 2px;
    border-radius: 2px;
}
.ui-slider-wrap .ui-slider-btn {
	background: #fff;
}
.ui-slider-wrap .ui-slider-btn:before {
    display: inline-block;
    font: normal normal normal 24px/1 "Material Design Icons";
    font-size: inherit;
    text-rendering: auto;
    line-height: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\f13e";
}
.ui-slider-wrap .ui-slider-btn.success:before {
	content: "\f12c";
}
.ui-slider-wrap .ui-slider-text {
	width: 100%;
	height: 100%;
	text-align: center;
	position: absolute;
	top: 0;
	left: 0;
	color: #4d5259;
}
.ui-slider-wrap .ui-slider-no-select {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-o-user-select: none;
	user-select: none
}
</style>
</head>
  
<body>
<div class="container-fluid">
  
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header"><h4>滑块验证 sliderVerification</h4></div>
        <div class="card-body">
          
          <p>原插件名jquery.slider.min.js，为了区分滑块插件，改成jquery.sliderVerification.min.js</p>
          <div id="slider-verification" class="slider"></div>
          <p class="m-t-10">验证结果：<span class="resultSpan"></span></p>
          <p><button class="btn btn-default" id="resetBtn">还原</button></p>
          
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.sliderVerification.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#slider-verification").slider({
        width: 340,                     // width
        height: 38,                     // height
        sliderBg: "#f9fafb",            // 滑块背景颜色
        color: "#8b95a5",               // 文字颜色
        fontSize: 14,                   // 文字大小
        bgColor: "#15c377",             // 背景颜色
        textMsg: "按住滑块，拖拽验证",     // 提示文字
        successMsg: "验证通过了哦",       // 验证成功提示文字
        successColor: "#fff",           // 滑块验证成功提示文字颜色
        time: 400,                      // 返回时间
        callback: function(result) {    // 回调函数，true(成功),false(失败)
            $(".resultSpan").text(result);
        }
    });
    
    // 还原
	$("#resetBtn").click(function() {
		$("#slider-verification").slider("restore");
	});
});
</script>
</body>
</html>